<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<!-- Bootstrap -->
<link th:href="@{/vendors/bootstrap/dist/css/bootstrap.min.css}"
	rel="stylesheet">
<!-- Font Awesome -->
<link th:href="@{/vendors/font-awesome/css/font-awesome.min.css}"
	rel="stylesheet">
<!-- NProgress -->
<link th:href="@{/vendors/nprogress/nprogress.css}" rel="stylesheet">
<!-- iCheck -->
<link th:href="@{/vendors/iCheck/skins/flat/green.css}" rel="stylesheet">
<!-- bootstrap-wysiwyg -->
<link th:href="@{/vendors/google-code-prettify/bin/prettify.min.css}"
	rel="stylesheet">
<!-- Select2 -->
<link th:href="@{/vendors/select2/dist/css/select2.min.css}"
	rel="stylesheet">
<!-- Switchery -->
<link th:href="@{/vendors/switchery/dist/switchery.min.css}"
	rel="stylesheet">
<!-- starrr -->
<link th:href="@{/vendors/starrr/dist/starrr.css}" rel="stylesheet">
<!-- bootstrap-daterangepicker -->
<link th:href="@{/vendors/bootstrap-daterangepicker/daterangepicker.css}"
	rel="stylesheet">

<!-- Datatables -->
<link th:href="@{/vendors/datatables.net-bs/css/dataTables.bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css}" rel="stylesheet">
<!-- Custom Theme Style -->
<link th:href="@{/build/css/custom.min.css}" rel="stylesheet">
</head>
<body class="nav-md">
	<div class="container body">
		<div class="main_container">
			<div class="col-md-3 left_col">
				<div class="left_col scroll-view">
					<!-- 左边导航栏上的用户信息显示 -->
					<div th:replace="common/index_module :: left_menu_profile"></div>
					<!-- 个人中心 -->
					<div th:replace="common/index_module :: profile"></div>
					<!-- 左边导航栏 -->
					<div th:replace="common/index_module :: left_menu"></div>
					<!-- 左边导航栏底部菜单 -->
					<div th:replace="common/index_module :: left_foot_menu"></div>
				</div>
			</div>

			<!-- 头部导航栏 -->
			<div th:replace="common/index_module :: top_nav"></div>
			<!-- /首页内容 -->

			<!-- 首页内容 -->
			<!-- page head -->
			<!-- page content -->
			<div class="right_col" role="main">
				<div class="">
					<div class="page-title">
						<div class="col-md-12 col-sm-12 col-xs-12">
							<!-- 商品搜索面板 -->
							<div class="x_panel">
								<div class="x_title">
									<h2>
										可根据以下条件搜索过滤<small>本商城内所有的订单数据,可根据订单状态、金额、类型名称以及时间范围进行搜索</small>
									</h2>
									<div class="clearfix"></div>
								</div>
								<!-- form表单搜索框 -->
								<div class="x_content">
									<div class="row">
										<div class="col-md-2 col-sm-12 col-xs-12 form-group">
						                    <input type="text" placeholder="活动标题" class="form-control" name="bt" id="in1">
					                 	</div>
					                  	<div class="col-md-1 col-sm-12 col-xs-12 form-group">
					                    	<button type="submit" class="btn btn-success col-md-12" onclick="lost()">搜索</button>
					                  	</div>
					                  	<div class="col-md-1 col-sm-12 col-xs-12 form-group">
					                    	<a  class="btn btn-success col-md-12" href="/lt_ssm/activity/tj_a">添加</a>
					                  	</div>
									</div>
								</div>
							</div>
							<div class="x_panel">
								<div class="x_title">
									<h2>
										搜索结果<small></small>
									</h2>
									<ul class="nav navbar-right panel_toolbox">
										<li><a class="collapse-link"><i
												class="fa fa-chevron-up"></i></a></li>
										<li class="dropdown"><a href="#" class="dropdown-toggle"
											data-toggle="dropdown" role="button" aria-expanded="false"><i
												class="fa fa-wrench"></i></a>
											<ul class="dropdown-menu" role="menu">
												<li><a href="#">Settings 1</a></li>
												<li><a href="#">Settings 2</a></li>
											</ul></li>
										<li><a class="close-link"><i class="fa fa-close"></i></a>
										</li>
									</ul>
									<div class="clearfix"></div>
								</div>

								<div class="x_content">
									<div class="table-responsive">
										<table class="table table-striped jambo_table bulk_action" id="productTable">
											<thead>
												<tr class="headings">
													<th class="column-title">活动id</th>
													<th class="column-title">活动主题</th>
													<th class="column-title">活动内容</th>
													<th class="column-title">开始时间</th>
													<th class="column-title">结束时间</th>
													<th class="column-title">操作</th>
													<th class="bulk-actions" colspan="7"><a class="antoo"
														style="color: #fff; font-weight: 500;">Bulk Actions (
															<span class="action-cnt"> </span> ) <i
															class="fa fa-chevron-down"></i>
													</a></th>
												</tr>
											</thead>
										</table>
									</div>

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /page content -->
			<!-- /首页内容 -->

			<!-- 尾部内容 -->
			<div th:replace="common/index_module :: foot"></div>
			<!-- /尾部内容 -->
		</div>
	</div>

	<!-- jQuery -->
	<script th:src="@{/vendors/jquery/dist/jquery.min.js}"></script>
	<!-- Bootstrap -->
	<script th:src="@{/vendors/bootstrap/dist/js/bootstrap.min.js}"></script>
	<!-- FastClick -->
	<script th:src="@{/vendors/fastclick/lib/fastclick.js}"></script>
	<!-- NProgress -->
	<script th:src="@{/vendors/nprogress/nprogress.js}"></script>
	<!-- Chart.js -->
	<script th:src="@{/vendors/Chart.js/dist/Chart.min.js}"></script>
	<!-- gauge.js -->
	<script th:src="@{/vendors/gauge.js/dist/gauge.min.js}"></script>
	<!-- bootstrap-progressbar -->
	<script
		th:src="@{/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js}"></script>
	<!-- iCheck -->
	<script th:src="@{/vendors/iCheck/icheck.min.js}"></script>
	<!-- Skycons -->
	<script th:src="@{/vendors/skycons/skycons.js}"></script>
	<!-- Flot -->
	<script th:src="@{/vendors/Flot/jquery.flot.js}"></script>
	<script th:src="@{/vendors/Flot/jquery.flot.pie.js}"></script>
	<script th:src="@{/vendors/Flot/jquery.flot.time.js}"></script>
	<script th:src="@{/vendors/Flot/jquery.flot.stack.js}"></script>
	<script th:src="@{/vendors/Flot/jquery.flot.resize.js}"></script>
	<!-- Flot plugins -->
	<script th:src="@{/vendors/flot.orderbars/js/jquery.flot.orderBars.js}"></script>
	<script th:src="@{/vendors/flot-spline/js/jquery.flot.spline.min.js}"></script>
	<script th:src="@{/vendors/flot.curvedlines/curvedLines.js}"></script>
	<!-- DateJS -->
	<script th:src="@{/vendors/DateJS/build/date.js}"></script>
	<!-- JQVMap -->
	<script th:src="@{/vendors/jqvmap/dist/jquery.vmap.js}"></script>
	<script th:src="@{/vendors/jqvmap/dist/maps/jquery.vmap.world.js}"></script>
	<script
		th:src="@{/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js}"></script>
	<!-- bootstrap-daterangepicker -->
	<script th:src="@{/vendors/moment/min/moment.min.js}"></script>
	<script
		th:src="@{/vendors/bootstrap-daterangepicker/daterangepicker.js}"></script>
	<!-- Custom Theme Scripts -->
	<script th:src="@{/build/js/custom.min.js}"></script>

	<!-- bootstrap-wysiwyg -->
	<script th:src="@{/vendors/bootstrap-wysiwyg/js/bootstrap-wysiwyg.min.js}"></script>
	<script th:src="@{/vendors/jquery.hotkeys/jquery.hotkeys.js}"></script>
	<script th:src="@{/vendors/google-code-prettify/src/prettify.js}"></script>
	<!-- jQuery Tags Input -->
	<script th:src="@{/vendors/jquery.tagsinput/src/jquery.tagsinput.js}"></script>
	<!-- Switchery -->
	<script th:src="@{/vendors/switchery/dist/switchery.min.js}"></script>
	<!-- Select2 -->
	<script th:src="@{/vendors/select2/dist/js/select2.full.min.js}"></script>
	<!-- Parsley -->
	<script th:src="@{/vendors/parsleyjs/dist/parsley.min.js}"></script>
	<!-- Autosize -->
	<script th:src="@{/vendors/autosize/dist/autosize.min.js}"></script>
	<!-- jQuery autocomplete -->
	<script th:src="@{/vendors/devbridge-autocomplete/dist/jquery.autocomplete.min.js}"></script>
	<!-- starrr -->
	<script th:src="@{/vendors/starrr/dist/starrr.js}"></script>
	
	<!-- Datatables -->
    <script th:src="@{/vendors/datatables.net/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-bs/js/dataTables.bootstrap.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-buttons/js/dataTables.buttons.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-buttons/js/buttons.flash.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-buttons/js/buttons.html5.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-buttons/js/buttons.print.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-keytable/js/dataTables.keyTable.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-responsive/js/dataTables.responsive.min.js}"></script>
    <script th:src="@{/vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js}"></script>
    <script th:src="@{/vendors/datatables.net-scroller/js/dataTables.scroller.min.js}"></script>
    <script th:src="@{/vendors/jszip/dist/jszip.min.js}"></script>
    <script th:src="@{/vendors/pdfmake/build/pdfmake.min.js}"></script>
    <script th:src="@{/vendors/pdfmake/build/vfs_fonts.js}"></script>

    <script type="text/javascript">
    function lost(){
		var in1 = $("#in1").val(); 
			 if(in1!=null){
			  	init("productTable","/lt_ssm/activity/Getin1/"+in1,"POST")
			 }
   }
    $(function(){
    	init("productTable","http://localhost/lt_ssm/activity/GetAll","post")
    });
    function init(tableId,url,type){
    	//网页内容中是静态的table表格，可以在此处修改需要用到的参数
    	//"searching" : false,去掉自带搜索框
    	//"bLengthChange":false,不显示每页条数
    	//"pagingType":   "simple_numbers" 分页样式
    	//columns 表格内容填充 ， 会自动读取ajax返回的json数据中的属性名
    	//"oLanguage" 底部基本样式效果
    	//"bProcessing" : true, //DataTables载入数据时，是否显示‘进度’提示  
        $('#'+tableId).DataTable({
        	"destroy" : true,       //销毁表格对象
        	"searching" : false,
        	"bLengthChange":false,
        	"aLengthMenu":[6],
        	//"pagingType":   "simple_numbers",
        	"paging": true,
        	"ajax":{
        		"url":url,
        		"type":type
        	},
        	//允许表格重新赋值
        	"bDestroy": true,
        	columns:[
        		{"data":"actId"},
        		{"data":"actHnmae"},
        		{"data":"content"},
        		{"data":"beginTime"},
        		{"data":"endTime"},
        	],
        	"columnDefs": [{
                "targets": 5,//编辑
                "data": null,
                "render" : function(data,type,row){
       			 var actId  = row.actId;
       			 var html="";
                	html+=	"<button onclick='Cdg("+actId+");' class='btn btn-primary' type='button'><i class='fa fa-edit'></i></button>";
                	html+=	"<button onclick='del("+actId+",this);' class='btn btn-primary' type='button'><i class='fa fa-trash-o'></i></button>";
                		return html;
                }
        	}],
        	
        	"oLanguage" : {
        		"sInfo" : "从 _START_ 到  _END_ 条记录 总记录数为 _TOTAL_ 条",
        		"oPaginate" : {
        			 "sFirst" : "第一页",
                     "sPrevious" : "上一页",
                     "sNext" : "下一页",
                     "sLast" : "最后一页"
                }
        	}
        });
    }
    function del(actId,event){
		$.ajax({
			url:"http://localhost/lt_ssm/activity/del/"+actId,
			success:function(response){
				if(response.success){
					alert("删除成功!");
					$(event).parent().parent().remove();
					window.location.reload();
				}
			},error:function(){
				alert("出现未知错误,请联系站内管理员!");
			}
		});
	}
    function Cdg(actId){
    	location.href="/lt_ssm/activity/byid/"+actId;
   }
    </script>
</body>

</html>